<template>
  <div class="minite-box-body">
    <div
      v-for="item in tableRows"
      :key="item"
      :class="[
        'minite-picker-item',
        item === selectedMinite ? 'minite-picker-item-selected' : '',
      ]"
      @click="handleCheck(item)"
    >
      {{ item }}
    </div>
  </div>
</template>

<script>
export default {
  name: 'MiniteTable',
  props: {
    // 选中的日期(选中渲染)
    selectedMinite: {
      type: String,
      required: true,
    },
  },
  data() {
    return {
      tableRows: ['00'],
      // tableRows: [
      //   '00',
      //   '05',
      //   '10',
      //   '15',
      //   '20',
      //   '25',
      //   '30',
      //   '35',
      //   '40',
      //   '45',
      //   '50',
      //   '55'
      // ]
    };
  },
  computed: {},
  methods: {
    handleCheck(val) {
      this.$emit('onSelectMinite', val);
    },
  },
};
</script>

<style lang="scss" scoped>
.minite-box-body {
  display: flex;
  flex-wrap: wrap;
  max-width: 160px;
  .minite-picker-item {
    line-height: 28px;
    width: 40px;
    text-align: center;
    cursor: pointer;
  }
  .minite-picker-item-selected {
    background-image: url('../../imgs/date-selected.png');
    background-position: center center;
    background-repeat: no-repeat;
  }
}
</style>
